GBML manual / Events

draw_gui_end

Runs every frame, fixed to the screen, after Draw GUI - a natural place for a screen-fixed cursor or tooltip. Everything drawn in it is on the screen layer: it counts from the screen’s top-left pixel, never scrolls with the camera, and sits on top of the room. Running later does not by itself draw on top of Draw GUI - depth decides that.

Syntax

draw_gui_end: fires every frame, fixed to the screen, after Draw GUI

Description

Runs every frame, fixed to the screen, right after Draw GUI - the same "one more event either side" shape Draw End already gives world-space drawing. A natural place for a screen-fixed cursor or a tooltip this instance wants drawn last. Like Draw GUI, everything drawn here is on the screen layer: (0, 0) is the top-left pixel of the screen, and it never scrolls with the camera.

Worth knowing before you lean on it: running later is not, by itself, a guarantee this event's content stacks on top of Draw GUI's. Event order only decides when a project's own code runs each frame - a separate thing from what actually decides on-screen stacking, which is bg_priority and depth. Every Draw GUI draw already shares one front-most layer (bg_priority's own "GUI content is always in front" section), so it is depth that settles which of two overlapping GUI draws wins - text included, draw_text/draw_text_warped read it exactly like draw_rect/draw_rect_fill do. Give this event's own content a lower depth than any GUI drawing it needs to stay above, and it stays on top regardless of which event drew which.

Example

draw_text(4, 4, "!");

Draws a marker pinned to the screen's top-left corner, after the rest of this instance's own Draw GUI content has drawn. Like any other pair of same-layer GUI drawings, it ties in depth with anything else this instance draws at the default, and it is the Game Boy Advance module's own same-band creation-order tie-break - not the fact that Draw GUI End happens to run last - that keeps it on top here. Give this event's own content a lower depth than whatever GUI drawing it needs to stay above - text included, since draw_text/draw_text_warped honor depth too - for a guaranteed order instead of a tie-break.

See also: draw_guidraw_gui_begindraw_endbg_prioritydepthEvents